﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;

namespace AbpDemo.EntityFrameworkCore
{
    public static class DbContextOptionsConfigurer
    {
        //TODO debug时跟踪SQL语句
        //private static ILoggerFactory SqlStatementLogger => new LoggerFactory().AddLog4Net();
        public static void Configure(
            DbContextOptionsBuilder<AbpDemoDbContext> dbContextOptions, 
            string connectionString
            )
        {
            /* This is the single point to configure DbContextOptions for AbpDemoDbContext */
            dbContextOptions.UseSqlServer(connectionString)
                //.UseLoggerFactory(SqlStatementLogger)  
                ;
        }
    }
}
